package com.tencent.wxcloudrun.vo.request.store;

import com.tencent.wxcloudrun.domain.TStoreProdType;
import com.tencent.wxcloudrun.vo.BaseReqVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @Author ZhaoZiYin
 * @Date 2025/4/22
 * @Description 新增商品分类请求入参
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "StoreProdTypeAddReqVo", description = "新增商品分类请求入参")
public class StoreProdTypeAddReqVo extends BaseReqVo {

    @NotBlank
    @ApiModelProperty("商品分类名称")
    private String name;

    @ApiModelProperty("商品分类描述")
    private String memo;

    public TStoreProdType build() {
        TStoreProdType prodType = new TStoreProdType();
        prodType.setName(name);
        prodType.setMemo(memo);
        prodType.setCreatedTime(LocalDateTime.now());
        prodType.setUpdatedTime(LocalDateTime.now());
        prodType.setCreatedBy(String.valueOf(this.getUserId()));
        prodType.setUpdatedBy(String.valueOf(this.getUserId()));
        return prodType;
    }

}
